<template>
	<view class="task_check">
		<view class="c-title  c-flex c-item-center" style="margin-top:13rpx;">
			<view class="title-icon"></view>
			<text style="margin-left: 15rpx;">审核结果</text>
		</view>




		<view class="d_radio c-flex c-item-center jc-between">
			<view class="personnel_num">审核结果</view>
			<view>
				<radio-group @change="radioChange" class=" c-flex jc-between">
					<label v-for="(item, index) in items" class=" c-flex c-item-center" :key="item.value">
						<view>
							<radio style="transform:scale(0.7)" color='#E86748' :value="item.value"
								:checked="item.value === current" />
						</view>
						<view>{{item.name}}</view>
					</label>
				</radio-group>
			</view>
		</view>



		<view class="d_textarea ">

			<textarea placeholder="请输入审核意见" maxlength='380' type="text" v-model="formObj.reason" />
		</view>


		<view class="submit_btn" @tap="submit()">
			提交
		</view>
		
	</view>
</template>

<script>
	import {
		toast,
		checkPositiveIntegers
	} from '@/utils/utils.js';
	var that;
	export default {
		data() {
			return {
				detailObj: null,
				current: 1,
				items: [{
					name: "通过",
					value: 1
				}, {
					name: "拒绝",
					value: 2
				}],



				placeholderStyle: {
					fontSize: "28rpx",
					color: " #000"
				},
				formObj: {
					userId: null,
					status: 1,
					reason: '',
			
				}
			};
		},
		onLoad(params) {
			that = this;
			this.formObj.userId = params.id;
			
			uni.setNavigationBarColor({
				backgroundColor:'#fff',
				frontColor:'#000000'
			});
		},
		methods: {
			/**
			 * 点击取消按钮触发
			 * @param {Object} done
			 */
			close() {

				this.$refs.report_popup.close()
			},
			/**
			 * 点击确认按钮触发
			 * @param {Object} done
			 * @param {Object} value
			 */
			confirm() {
				this.$refs.report_popup.close()

			},
			radioChange(evt) {
				this.formObj.status = evt.detail.value;

			},
			submit() {
				if (this.formObj.status == 2 && this.formObj.reason == '') {
					toast('请填写拒绝原因')
					return;
				}
			
			
				this.$API.lpguserAudit(this.formObj).then(res => {
					if (res.code == 0) {
						
							
						uni.navigateBack();
						
					}
				})
			}
		}
	}
</script>
<style>
	page {
		height: 100%;
		background: #F9F9F9;
	}
</style>
<style lang="scss" scoped>
	.task_check {

		padding: 14rpx 32rpx 32rpx 32rpx;
		.title-icon{
			width: 12rpx;
			height: 32rpx;
			background: linear-gradient( 180deg, #F18858 0%, #E86547 100%);
			transform: skew(-10deg);
			margin-left: 30rpx;
		}
		.submit_btn {

			text-align: center;
			position: absolute;

			bottom: 116rpx;
			left: 50%;
			transform: translate(-50%, -50%);
			width: 686rpx;
			height: 90rpx;
			line-height: 90rpx;
			background: #E86748;
			border-radius: 20rpx;
			border: 2rpx solid #E86748;
			font-size: 28rpx;
			font-family: PingFangSC-Semibold, PingFang SC;
			font-weight: 600;
			color: #FFFFFF;

		}






		.d_radio {
			margin: 28rpx auto;
			width: 686rpx;
			height: 100rpx;
			background: #FFFFFF;
			border-radius: 20rpx;

			.personnel_num {
				padding-left: 26rpx;
				font-size: 28rpx;
				font-family: PingFang-SC-Medium, PingFang-SC;
				font-weight: 500;
				color: #676767;
			}

			radio-group {

				width: 140px;
				padding-right: 28rpx;
			}
		}

		.d_textarea {
			width: 686rpx;
			min-height: 500rpx;
			background: #FFFFFF;
			border-radius: 20rpx;
			margin: 20rpx auto;

			textarea {
				width: 630rpx;
				height: 470rpx;
				/* margin-top: -110px; */
				padding: 36rpx 27rpx;
			}
		}


	}
</style>